// pages/search/search.js
const {movieSearch} = require("../../models/movie")
Page({
  data: {
    searchMovie:"",
    keyword:"",
    isFocus:""
  },
  onLoad: function (options) {
    this.setData({
      isFocus:true
    })
  },
  handleSearch(event){
    var value = event.detail.value
    movieSearch(value).then(res=>{
      var searchMovie = res.data.result
      this.setData({
        keyword:value,
        searchMovie
      })
    })
  },
})